]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
fileUtils: Do not follow symlinks
authorFlorian Müllner <fmuellner@gnome.org>
Mon, 5 Dec 2022 12:56:57 +0000 (13:56 +0100)
committerMarge Bot <marge-bot@gnome.org>
Thu, 15 Dec 2022 22:34:26 +0000 (22:34 +0000)
Extensions should not include symlinks, in particular ones that
point outside the extension directory. However if they do, then
we should only move/remove the link rather than the files it
points to.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/6182

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2571>

js/misc/fileUtils.js

index e9ea92a519feebca892015b2e7e6c5252cb412c4..528a763501cc2466b9738d3f0fb7125af341547c 100644 (file)
@@ -45,7 +45,7 @@ function* collectFromDatadirs(subdir, includeUserDir) {
 
 function recursivelyDeleteDir(dir, deleteParent) {
     let children = dir.enumerate_children('standard::name,standard::type',
-                                          Gio.FileQueryInfoFlags.NONE, null);
+        Gio.FileQueryInfoFlags.NOFOLLOW_SYMLINKS, null);
 
     let info;
     while ((info = children.next_file(null)) != null) {
@@ -63,7 +63,7 @@ function recursivelyDeleteDir(dir, deleteParent) {
 
 function recursivelyMoveDir(srcDir, destDir) {
     let children = srcDir.enumerate_children('standard::name,standard::type',
-                                             Gio.FileQueryInfoFlags.NONE, null);
+        Gio.FileQueryInfoFlags.NOFOLLOW_SYMLINKS, null);
 
     if (!destDir.query_exists(null))
         destDir.make_directory_with_parents(null);